var child_process = require('child_process');
var rimraf = require('rimraf');
var _ = require('lodash');
var expandHomeDir = require('expand-home-dir');

module.exports = function(opt) {
  var self = _.defaults(require('./global')(), {
    dataDir: expandHomeDir('~/.parity'),
    spawn: function() {
      return self.process = child_process.spawn('parity', [
        '-j',
        opt.enode
      ]);
    }
  });

  return self;
};
